import request from '@/config/axios'

// 创作类别 VO
export interface CreationCategoryVO {
  id: number // 主键ID
  name: string // 类目名称
  sort: number // 排序
  status: number // 状态：1-开启，0-关闭
}

// 创作类别 API
export const CreationCategoryApi = {
  // 查询创作类别分页
  getCreationCategoryPage: async (params: any) => {
    return await request.get({ url: `/ai/creation-category/page`, params })
  },

  // 查询创作类别详情
  getCreationCategory: async (id: number) => {
    return await request.get({ url: `/ai/creation-category/get?id=` + id })
  },

  // 新增创作类别
  createCreationCategory: async (data: CreationCategoryVO) => {
    return await request.post({ url: `/ai/creation-category/create`, data })
  },

  // 修改创作类别
  updateCreationCategory: async (data: CreationCategoryVO) => {
    return await request.put({ url: `/ai/creation-category/update`, data })
  },

  // 删除创作类别
  deleteCreationCategory: async (id: number) => {
    return await request.delete({ url: `/ai/creation-category/delete?id=` + id })
  },

  // 导出创作类别 Excel
  exportCreationCategory: async (params) => {
    return await request.download({ url: `/ai/creation-category/export-excel`, params })
  },

// ==================== 子表（创作模型） ====================

  // 获得创作模型分页
  getCreationModelPage: async (params) => {
    return await request.get({ url: `/ai/creation-category/creation-model/page`, params })
  },
  // 新增创作模型
  createCreationModel: async (data) => {
    return await request.post({ url: `/ai/creation-category/creation-model/create`, data })
  },

  // 修改创作模型
  updateCreationModel: async (data) => {
    return await request.put({ url: `/ai/creation-category/creation-model/update`, data })
  },

  // 删除创作模型
  deleteCreationModel: async (id: number) => {
    return await request.delete({ url: `/ai/creation-category/creation-model/delete?id=` + id })
  },

  // 获得创作模型
  getCreationModel: async (id: number) => {
    return await request.get({ url: `/ai/creation-category/creation-model/get?id=` + id })
  },
}